<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsgtexturematerial.cpp -->
  <title>QSGTextureMaterial 类 | Qt Quick 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-module.html">C++ 类</a></td><td >QSGTextureMaterial</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">目录</a></h3>
<ul>
<li class="level1"><a href="#details">详细信息</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QSGTextureMaterial 类</h1>
<!-- $$$QSGTextureMaterial-brief -->
<p>
<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgtexturematerial.html">
QSGTextureMaterial</a>类提供渲染场景图纹理几何形状的一种便捷方式。<a href="#details">更多...</a></p>
<!-- @@@QSGTextureMaterial -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign">头文件：</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QSGTextureMaterial&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += quick</td></tr><tr><td class="memItemLeft rightAlign topAlign">继承自：</td><td class="memItemRight bottomAlign"> <a href="qsgopaquetexturematerial.html">QSGOpaqueTextureMaterial</a></td></tr></table></div><ul>
<li><a href="qsgtexturematerial-members.html">所有成员的列表，包括继承成员</a></li>
</ul>
<h3>额外的继承成员</h3>
<ul>
<li class="fn">12 个公用函数继承自<a href="qsgopaquetexturematerial.html#public-functions">QSGOpaqueTextureMaterial</a></li>
<li class="fn">5 个公用函数继承自<a href="qsgmaterial.html#public-functions">QSGMaterial</a></li>
</ul>
<a name="details"></a>
<!-- $$$QSGTextureMaterial-description -->
<div class="descr">
<h2 id="details">详细信息</h2>
<p>
<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgtexturematerial.html">
QSGTextureMaterial</a>类提供了场景图中绘制纹理几何形状的一种便捷方式。</p>
<p><b>警告：</b>此实用程序类仅在与 Qt Quick 场景图的 OpenGL 后端一起运行时才起作用。</p>
<p>纹理材质将使用提供的纹理填充几何体中的每个像素。</p>
<p>使用纹理材质渲染的几何体需要属性位置 0 中的顶点和属性位置 1 中的纹理坐标。纹理坐标是一个二维浮点元组。该<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsggeometry.html#defaultAttributes_TexturedPoint2D">QSGGeometry :: defaultAttributes_TexturedPoint2D</a>返回一个属性集用这种材料兼容。</p>
<p>要渲染的纹理可以使用<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgopaquetexturematerial.html#setTexture">setTexture</a> ()设置。可以使用<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgopaquetexturematerial.html#setMipmapFiltering">setMipmapFiltering</a> ()、<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgopaquetexturematerial.html#setFiltering">setFiltering</a> ()、<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgopaquetexturematerial.html#setHorizontalWrapMode">setHorizo​​ntalWrapMode</a> () 和<a href="file:///E:/_Personal/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgopaquetexturematerial.html#setVerticalWrapMode">setVerticalWrapMode</a> ()指定如何渲染纹理。渲染状态在绑定之前在纹理实例上设置。</p>
<p>纹理材质尊重当前矩阵和纹理的 alpha 通道。它还将尊重场景图中​​的累积不透明度。</p>
<p>纹理材质在用作场景图中的材质之前必须具有纹理集。</p>
</div>
<!-- @@@QSGTextureMaterial -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
